#!/bin/bash

DOCXML="word/document.xml"

if [ ! -f "$DOCXML" ]; then
  echo "Error: $DOCXML not found!"
  exit 1
fi

echo "统计正文中使用的段落样式（w:styleId）及其出现次数："

grep -oP 'w:styleId="\K[^"]+' "$DOCXML" | sort | uniq -c | sort -nr
